package zuoye23.zuoye1;

public class Circle {
//    1:圆类有半径属性和圆周率属性，有求面积和周长的方法（把圆周率定义成static），用oop模拟。
    private double r ;
    static double pi=3.14;

    public Circle() {

    }
    //计算周长的方法
    public double jishuan(double r ,double pi){
        double box = r*pi;
        return box;
    }

    //计算面积
    public double mianji(double r ,double pi){
        double box = r * r * pi;
        return box;
    }

    public Circle(double r) {
        this.r = r;
    }

    public double getR() {
        return r;
    }

    public void setR(double r) {
        this.r = r;
    }

    public static double getPi() {
        return pi;
    }

    public static void setPi(double pi) {
        Circle.pi = pi;
    }


}
